<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>table模块快速使用</title>
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <link rel="stylesheet" href="/layuiAdmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiAdmin/css/admin.css" media="all">
</head>

<body>


<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">操作人</label>
                    <div class="layui-input-block">
                        <input type="text" name="session_id" placeholder="请输入" autocomplete="off" class="layui-input" id="session_id">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">操作</label>
                    <div class="layui-input-block">
                        <input type="text" name="action" placeholder="请输入" autocomplete="off" class="layui-input" id="action">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">内容</label>
                    <div class="layui-input-block">
                        <input type="text" name="content" placeholder="请输入" autocomplete="off" class="layui-input" id="content">
                    </div>
                </div>
               {{-- <div class="layui-inline">
                    <label class="layui-form-label">状态</label>
                    <div class="layui-input-block">
                        <select name="is_show" id="is_show">
                            <option value="">不限</option>
                            <option value="1">显示</option>
                            <option value="0">隐藏</option>
                        </select>
                    </div>
                </div>--}}
                <div class="layui-inline">
                    <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="LAY-user-front-search" id="search">
                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                    </button>
                </div>
            </div>
        </div>

        <div class="layui-card-body">

            <table class="layui-table" lay-data="{url:'/admin/businessLog', page:true, limit:90, id:'test',height: 'full-25'}" lay-filter="test" id="test">
                <thead>
                <tr>
                    <th lay-data="{checkbox:true}"></th>
                    <th lay-data="{field:'id', width:80, sort: true}">ID</th>
                    <th lay-data="{field:'session_id', width:160, sort: true}">操作人</th>
                    <th lay-data="{field:'action', width:200, sort: true}">操作</th>
                    <th lay-data="{field:'content',width:900}">内容</th>
                    <th lay-data="{field:'created_at',width:200, sort: true}">记录时间</th>
                </tr>
                </thead>
            </table>


        </div>
    </div>
</div>
<script src="/layuiAdmin/layui/layui.js"></script>
<script src="/layuiAdmin/tool.js"></script>
<script>
    layui.use(['table','form'], function() {
        var table = layui.table ;
        var $ = layui.jquery,
            layer = layui.layer,
            form = layui.form;

        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            }
        });



        $('#search').click(function () {
            reload();
        });


        function reload() {
            table.reload('test', {
                url: '/admin/businessLog'
                ,where: {
                    action : $('#action').val(),
                    content : $('#content').val(),
                    session_id : $('#session_id').val(),
                }
                ,page: {
                    curr: 1
                }
            });
        }

    });
</script>
</body>

</html>